package com.lanou.tk.tourism.splash;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.lanou.tk.tourism.activity.MainActivity;
import com.lanou.tk.tourism.R;

/**
 * Created by dllo on 15/10/21.
 */
public class SplashActivity extends Activity {

    private Handler handler;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);


        handler = new Handler(new Handler.Callback() {

            @Override
            public boolean handleMessage(Message msg) {
                //页面跳转  Intent (SplashActivity.this, MainActivity.class) Splash 跳到 Main
                Intent intent = new Intent(SplashActivity.this, MainActivity.class);


                startActivity(intent);
                finish();// 关闭页面
                return false;
            }
        });
        //延时4秒发送一条空消息 通知要进行页面跳转了
        handler.sendEmptyMessageDelayed(100, 4000);


    }
}
